package com.watson.grpc.service;

/**
 * @Author watson
 * @Date 2022/7/4 15:14
 * @Description: TODO
 * @Version 1.0
 */

public class HelloWorldService extends HelloWorldServiceGrpc.HelloWorldServiceImplBase {
    @Override
    public void welcome(HelloWorld.NameRequest request, StreamObserver<HelloWorld.EchoResponse> responseObserver) {
        HelloWorld.EchoResponseOrBuilder echoResponseOrBuilder = HelloWorld.EchoResponse.newBuilder();
        ((HelloWorld.EchoResponse.Builder) echoResponseOrBuilder).setMergename("welcome " + request.getName());
        responseObserver.onNext(((HelloWorld.EchoResponse.Builder) echoResponseOrBuilder).build());
        responseObserver.onCompleted();
    }
}
